{*include file="template/admin_head.htm"*}
<link rel="stylesheet" href="/public/js/tageditor/jquery.tag-editor.css">
<script src="/public/js/tageditor/jquery.tag-editor.js"></script>
<script src="/public/js/jquery/jquery.colorpicker.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="/public/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/js/ueditor/ueditor.all.js"> </script>
<script type="text/javascript" charset="utf-8" src="/public/js/ueditor/lang/zh-cn/zh-cn.js"></script>

<table id="containtable" cellspacing="0" cellpadding="0" class="{*$cf_controller*}">
    <tr>
        <td width="1979" valign="top" bgcolor="#FFFFFF">
            <div class="wrapper pr_8">
			{*if $cf_action=='add' || $cf_action=='edit'*}
            
			<script type="text/javascript">
			 $(function(){					
				$("#act_form").submit(function(){
					if($("#article_title").val() == ''){
						my_alert('请输入标题','错误提示',"$('#article_title').focus()");
						return false;										
					}	
					if($("#article_tags").val() == ''){
						my_alert('请输入标签','错误提示',"$('#article_tags').focus()");
						return false;										
					}	
					if($("#article_description").val() == ''){
						my_alert('请输入简要描述','错误提示',"$('#article_description').focus()");
						return false;										
					}
					if($("#article_image_path").val() == ''){
						my_alert('请上传封面图','错误提示',"$('#article_image_path').focus()");
						return false;										
					}					
				});
				
				call_uploader('#article_image_path_button','#article_image_path','nofix',{'show':'#article_image_path_show'});
				{*if $row['article_image_path']*}
				$("#article_image_path_show").append(show_photo_div("#article_image_path_button","#article_image_path","{*$row['article_image_path']*}","admin",false));
				{*/if*}
				
								
				call_editor('#article_content','full');
				$('#article_tags').tagEditor({ initialTags: [{*$row['article_tags']*}], placeholder: '请输入标签' });
				

		    });
				
				var ue = UE.getEditor('editor');
				
			</script>
			
			<div class="content_panel_title">
				<div class="contentpanelleft"></div>
				<div class="contentpanelcenter">
					<span class="contentpanelcenter_font">新增/修改文章</span>
					<span><a class="edit at" href="{*$cf_self_page*}?dpt={*$cf_dpt*}">文章管理</a></span>
				</div>
				<div class="contentpanelrihgt"></div>
            </div>
			<div class="bq clearfix">
			<b><a href="javascript:void(0)" class="tapbt">文章信息</a></b>			
			</div>

			
			<div class="content_table_center_style">
                    <div class="p8">

                        <form name="act_form" id="act_form" method="post" action="{*$cf_self_page*}">
                            <input name="id" id="id" type="hidden" value="{*$row['article_id']*}" />
                            <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
                            <input name="act" id="act" type="hidden" value="{*$cf_action*}" />
				

				
				<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tbl tbl_nbr">
				<tbody>					
				    <tr>
					<td width="11%" align="right">标题:</td>
					<td colspan="3" align="left"><input type="text" size="60" id="article_title" name="article_title" value="{*$row['article_title']*}" /></td>
				    </tr>
					<tr>
					<td width="11%" align="right">分类:</td>
					<td colspan="3" align="left"> {*html_options name=article_cate_id options=$article_cate selected=$row['article_cate_id']|default:''*}</td>
				    </tr>
					
					 <tr>
					 	<td align="right">标签:</td>
					 	<td colspan="3" align="left"><input type="text" id="article_tags" name="article_tags"/></td>
				 	</tr>
					 <tr>
					<td align="right">简要描述:</td>
					<td colspan="3" align="left"><textarea name="article_description" id="article_description" cols="100" rows="5">{*$row.article_description*}</textarea></td>
					</tr>			    
				   
                    <tr>
						<td align="right">封面图:</td>
						<td colspan="3" ><span id='article_image_path_show'><img style="cursor:pointer" id="article_image_path_button" src="/public/images/admin/upload.jpg" /></span>
							<input type="hidden" name="article_image_path" id="article_image_path" value="{*$row['article_image_path']*}" /></td>
						
					</tr>  
				    <tr>
					<td align="right">详细内容:</td>
					<td colspan="3" align="left">
					    <script id="editor" name="article_content" type="text/plain" style="width:850px;height:500px;">{*$row["article_content"]*}</script> </td>
				    </tr>
                    <tr>
					<td align="right">是否推荐到首页:</td>
					<td colspan="3" align="left">{*html_radios name=article_recommand_flag options=$cf_info_var_common['yesno'] checked=$row['article_recommand_flag']|default:'0'*}</td>
				    </tr>
                    <tr>
					<td align="right">是否显示:</td>
					<td colspan="3" align="left">{*html_radios name=article_status options=$cf_info_var_common['yesno'] checked=$row['article_status']|default:'1'*}</td>
				    </tr>
                    <tr>
					<td width="11%" align="right">作者:{*$cf_admin_info['user_name']*}</td>
					<td width="27%" align="left"><input type="text" id="article_author" name="article_author" value="{*$row['article_author']|default:{*$cf_admin_info['admin_name']*}*}" /></td>
				    <td width="12%" align="right">文章访问次数:</td>
                    <td width="50%" align="left"><input type="text" id="article_total_visits" name="article_total_visits" value="{*$row['article_total_visits']*}"  /></td>
                    </tr>           

				</tbody>
			    </table>				
				
				<div class="pt_8" align="center"><input type="submit" name="Submit" value="提 交" class="myinput" />
                 &nbsp;&nbsp;<input type="button" name="back" value="返 回" onclick="window.history.back()" class="myinput" /></div>
                     </form>
                    </div>
                </div>
				
				<div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>
			{*elseif $cf_action=='detail'*}
			<div class="content_panel_title">
				<div class="contentpanelleft"></div>
				<div class="contentpanelcenter">
					<span class="contentpanelcenter_font">文章详情</span>
					<span><a class="edit at" href="{*$cf_self_page*}?dpt={*$cf_dpt*}">文章管理</a></span></div>
				<div class="contentpanelrihgt"></div>
            </div>
			
			<div class="content_table_center_style">
                    <div class="p8">
						<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tbl tbl_nbr">
				<tbody>					
				    <tr>
					<td width="12%" align="right">标题:</td>
					<td colspan="3" align="left">{*$row['article_title']*}</td>
				    </tr>
					<tr>
					<td width="12%" align="right">分类:</td>
					<td colspan="3" align="left">{*$article_cate[$row['article_cate_id']]*}</td>
				    </tr>
					
					 <tr>
					 	<td align="right">标签:</td>
					 	<td colspan="3" align="left">{*$row['article_tags']*}</td>
				 	</tr>
					 <tr>
					<td align="right">简要描述:</td>
					<td colspan="3" align="left">{*$row.article_description*}</td>
					</tr>			    
				   
                    <tr>
						<td align="right">封面图:</td>
						<td colspan="3" ><img src="{*$row['article_image_path']*}" /></td>
						
					</tr>  
				    <tr>
					<td align="right">详细内容:</td>
					<td colspan="3" align="left">{*$row.article_content*}</td>
				    </tr>
                    <tr>
					<td align="right">是否推荐到首页:</td>
					<td colspan="3" align="left">{*html_radios name=article_recommand_flag options=$cf_info_var_common['yesno'] checked=$row['article_recommand_flag']|default:'0'*}</td>
				    </tr>
                    <tr>
					<td align="right">是否显示:</td>
					<td colspan="3" align="left">{*html_radios name=article_status options=$cf_info_var_common['yesno'] checked=$row['article_status']|default:'1'*}</td>
				    </tr>
                    <tr>
					<td width="12%" align="right">作者:</td>
					<td colspan="3" align="left">{*$row['article_author']*}</td>
				    </tr>
                     <tr>
					<td width="12%" align="right">访问数:</td>
					<td colspan="3" align="left">{*$row['article_total_visits']*}</td>
				    </tr>
                    <tr>
					<td width="12%" align="right">修改时间:</td>
					<td colspan="3" align="left">{*$row['article_edit_time']*}</td>
				    </tr> 
                    <tr>
					<td width="12%" align="right">创建时间:</td>
					<td colspan="3" align="left">{*$row['article_create_time']*}</td>
				    </tr>             

				</tbody>
			    </table>

                        
                    </div>
                </div>
				
			<div class="content_main_bottom">
				<div class="content_main_bottom_left"></div>
				<div class="content_main_bottom_right"></div>
		    </div>
			
			{*else*}
			<script type="text/javascript">
			
			$(function(){
				load_province('cate',"{*$cate1*}","{*$cate2*}");
				$("#cate1").change(function(){                                   //更改分类
					change_province('cate',$(this).val());
				});
				
				$("#checkall").toggle(
                    function(){
                        select_all("idlist[]",true);
                    },
                    function(){
                        select_all("idlist[]",false);
                    }
                );
				
				$("#list_form").submit(function(){
					if(!count_select("idlist[]")){
						my_alert('请选择记录','操作提示');
						return false;
					};
					if($("#alltype").val()==''){
						my_alert('请选择操作方式','Error',"$('#alltype').focus()");
						return false;
					};
					if(confirm('确定进行操作?')==false){
						return false;
					}
					return true;
                });
				
				
			})
			</script>
            
            <div class="pannel">
			<div class="pl"></div>
			<div class="pr"></div>
			<div class="pc1">
			    <form action="" method="get" id="search_form" name="search_form">
				<input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
				<div class="pt">
				    标题:
				   <input type="text" size="20" id="skey" name="skey" class="tet" value="{*$skey*}" />
                   分类:{*html_options id=skey4 name=skey4 options=$article_cate selected=$skey4|default:''*}
                   	&nbsp;&nbsp;创建时间:
					<input name="skey2" class="Wdate" type="text" id="act_start" value="{*$skey2*}" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'act_end\')}',dateFmt:'yyyy-MM-dd',isShowClear:true,readOnly:true});" size="12" maxlength="30" />
					到<input name="skey3" class="Wdate" type="text" id="act_end" value="{*$skey3*}" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'act_start\')}',dateFmt:'yyyy-MM-dd',isShowClear:true,readOnly:true});" size="12" maxlength="30" />
					 &nbsp;				   
				   <input type="image" src="public/images/admin/icon_search_btn.gif" />
				</div>
			    </form>
			</div>
		    </div>			
			
			<div class="content_panel_title">
				<div class="contentpanelleft"></div>
				<div class="contentpanelcenter">
					<span class="contentpanelcenter_font">文章管理</span>
					<span><a class="edit at" href="{*$cf_self_path*}-act_add.htm?dpt={*$cf_dpt*}">添加文章</a></span>&nbsp;
				</div>
				<div class="contentpanelrihgt"></div>
		    </div>
			
			<div class="content_table_center_style">
			<div class="p8">
			    
			    <form name="list_form" id="list_form" method="post" action="{*$cf_self_page*}">
				<input name="act" type="hidden" value="all" />
				<input name="dpt" type="hidden" value="{*$cf_dpt*}" />
				<table width="100%" class="tbl tbl_nbr">
				    <thead>
					<tr class="thd">
					    <td width="4%" height="26" align="center" class="thr">ID</td>
					    <td width="21%" align="center" class="thr">文章标题</td>
					    <td width="11%" align="center" class="thr">分类</td>
					    <td width="8%" align="center" class="thr">图片</td>
					    <td width="6%" align="center" class="thr">是否推荐</td>
					    <td width="7%" align="center" class="thr">是否显示</td>
					    <td width="10%" align="center" class="thr">作者</td>
					    <td width="11%" align="center" class="thr">访问总数</td>
					    <td width="12%" align="center" class="thr">创建时间</td>
					    <td colspan="2" align="center" class="thr">操作</td>
					</tr>
				    </thead>
				    <tbody>
					{*foreach $data_ary as $item*}
					<tr onmouseout="this.style.backgroundColor='#ffF'" onmouseover="this.style.backgroundColor='#ffC'">
					    <td align="center">{*$item['article_id']*}</td>
					    <td align="left"><a href="/default/article-act_detail_id_{*$item['article_id']*}.htm" title="查看詳情" class="edit" target="_blank" >{*$item['article_title']*}</a></td>
					    <td align="left">{*$article_cate[$item['article_cate_id']]*}</td>
					    <td align="center"><a href="{*$item['article_image_path']*}" target="_blank"><img width="50" height="40" src="{*$item['article_image_path']*}" /></a></td>
					    <td align="center">{*$cf_info_var_common['yesno'][$item['article_recommand_flag']]*}</td>
					    <td align="center">{*$cf_info_var_common['yesno'][$item['article_status']]*}</td>
					    <td align="center">{*$item['article_author']*}</td>
					    <td align="center">{*$item['article_total_visits']*}</td>
					    <td align="center">{*$item['article_create_time']*}</td>
					    <td width="4%" align="center"><a href="{*$cf_self_path*}-act_edit_id_{*$item['article_id']*}.htm?dpt={*$cf_dpt*}" class="edit">修改</a></td>
					    <td width="6%" align="center"><a href="{*$cf_self_path*}-act_del_id_{*$item['article_id']*}.htm?dpt={*$cf_dpt*}" class="del" onclick="return confirm('你确定要删除吗?')">删除</a></td>
                      </tr>
					{*/foreach*}
					<tr class="tft">
					    <td colspan="11" style="padding:0;">
						<table width="100%" border="0">
						    <tr>
							<td align="center" style="border:0;padding:0;"><div class="turnPage"><p>{*$page*}</p></div></td>
							</tr>
						</table>                                </td>
					</tr>
				    </tbody>
				</table>
			    </form>
			</div>
		    </div>
			
			<div class="content_main_bottom">
				<div class="content_main_bottom_left"></div>
				<div class="content_main_bottom_right"></div>
		    </div>			

		    {*/if*}
			</div>
		</td>
    </tr>
</table>
{*include file="template/admin_foot.htm"*}